package {
	import flash.display.*;
	import flash.events.*;
	import flash.utils.*;

[SWF(width="340", height="340", frameRate="24", backgroundColor="#666666")]

	public class PhotoWallet extends Sprite
	{
		
		private var _photoModel:PhotoWalletModel;
		private var _photoView:PhotoWalletView;
		private var _photoController:PhotoWalletController;
		private var _photoListURL:String;
		
		public function PhotoWallet()
		{
			
			stage.align = StageAlign.LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			// This will ultimately be set in a flashVars <param>
			_photoListURL = 'http://pixelthings.net/thunder/PhotoWallet/test.xml.php' ;
			
			_photoModel = new PhotoWalletModel( _photoListURL );
			
			// XML photo list must load before continuing
			_photoModel.addEventListener( PhotoWalletModel.XML_LOADED, addPhotoView );
			
		}
		
		private function addPhotoView( e:Event ):void {
			
			_photoView = new PhotoWalletView( _photoModel );
			addChild( _photoView );
			_photoController = new PhotoWalletController( _photoModel, _photoView );		
			
		}
				
		
	}
}
